<?php
$urlManagers = [
    'urlManagerFrontend' => [
        'class' => 'yii\web\UrlManager',
        'baseUrl' => THIS_SERVER_BASE_URI."/frontend",
        'scriptUrl' => THIS_SERVER_BASE_URI."/frontend/index.php",
        'hostInfo' => THIS_SERVER_BASE_URI,
        'enablePrettyUrl' => true,
        'showScriptName' => false,
//        'enableStrictParsing' => true,
    ],
    'urlManagerBackend' => [
        'class' => 'yii\web\UrlManager',
        'baseUrl' => THIS_SERVER_BASE_URI."/backend",
        'hostInfo' => THIS_SERVER_BASE_URI,
        'scriptUrl' => THIS_SERVER_BASE_URI."/backend/index.php",
    ],
    'urlManagerSmalldmin' => [
        'class' => 'yii\web\UrlManager',
        'baseUrl' => THIS_SERVER_BASE_URI."/smalldmin",
        'hostInfo' => THIS_SERVER_BASE_URI,
        'scriptUrl' => THIS_SERVER_BASE_URI."/smalldmin/index.php",
    ],
    'urlManagerFztadmin' => [
        'class' => 'yii\web\UrlManager',
        'baseUrl' => THIS_SERVER_BASE_URI."/fztadmin",
        'hostInfo' => THIS_SERVER_BASE_URI,
        'scriptUrl' => THIS_SERVER_BASE_URI."/fztadmin/index.php",
    ],
];

$_apiConfig = \wodrow\yii\rest\Controller::getConfig();
$urlManagers['urlManagerApi']['class'] = 'yii\web\UrlManager';
$urlManagers['urlManagerApi']['baseUrl'] = THIS_SERVER_BASE_URI."/api";
$urlManagers['urlManagerApi']['hostInfo'] = THIS_SERVER_BASE_URI;
$urlManagers['urlManagerApi']['scriptUrl'] = THIS_SERVER_BASE_URI."/api/index.php";
$urlManagers['urlManagerApi']['rules']['/'] = 'route/api';
$urlManagers['urlManagerApi'] = array_merge($urlManagers['urlManagerApi'], $_apiConfig['components']['urlManager']);

return $urlManagers;